//更改用户手机号
function pho() {
  let ust = document.getElementById("utp").value.trim();
  console.log(ust);
  let userPassword = document.getElementById("recipient-name").value;
  let usp = document.getElementById("pasw").value;
  // console.log(userPassword);
  let userId = document.getElementById("usi").value;
  let userTelephone = document.getElementById("message-text").value;
  console.log(userTelephone);
  // console.log(userId);
  if (userPassword == usp && userTelephone != ust){

    $.post('/mi/personal_center/jiaoyan', {userTelephone:userTelephone},
        function (res) {
          if(res.code==='200'){
            window.location="/mi/personal_center/personal_login2?userId="+parseInt(userId)+"&userTelephone="+userTelephone;
          }else if (res.code==='500'){
            layer.alert(res.data);
          }
    });
  }else if (userTelephone == ust){
    $('#f5').popover('show')
    $('#f').popover('hide')
  }else{
    $('#f').popover('show')
  }
}

//更改用户邮箱
function ema() {
  let userPassword = document.getElementById("recipient-name2").value;
  let usp = document.getElementById("pasw").value;
  let userId = document.getElementById("usi").value;
  let userEmail = document.getElementById("message-text2").value;
  let use = document.getElementById("uem").value;
  if (userPassword == usp && userEmail != use){
    window.location="/mi/personal_center/personal_login3?userId="+parseInt(userId)+"&userEmail="+userEmail;
  }else if (userEmail == use){
    $('#f4').popover('show')
    $('#f1').popover('hide')
  }else{
    $('#f1').popover('show')
  }
}

//更改用户密码
function pas() {
  let userPassword = document.getElementById("recipient-name3").value;
  let usp = document.getElementById("pasw").value;
  let userId = document.getElementById("usi").value;
  let userPassword2 = document.getElementById("message-text3").value;
  if (userPassword == usp && userPassword2 != usp){
    window.location="/mi/personal_center/personal_login4?userId="+parseInt(userId)+"&userPassword="+userPassword2;
  }else if(userPassword2 == usp){
    $('#f3').popover('show')
    $('#f2').popover('hide')
  }else{
    $('#f2').popover('show')
  }
}